import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    //配置拦截
    {
        path: '/',
        redirect: '/admin',
    },
    //商家路由
    {
        path: '/merchant',
        component: () => import('@/views/merchant/merLogin.vue')
    },
    //管理员路由
    {
        // menu: true,
        path: '/admin',
        component: () => import('@/views/admin/index.vue'),
        children: [
            {
                path: '',
                redirect: '/admin/admLogin',
            },
            {
                path: 'admLogin',
                component: () => import('@/views/admin/admLogin/admLogin.vue')
            },
            {
                path: 'admSystem',
                component: () => import('@/views/admin/admSystem/index.vue'),
                children: [
                    {
                        path: '',
                        redirect: '/admin/admSystem/home'
                    }, {
                        path: 'home',
                        component: () => import('@/views/admin/admSystem/home/index.vue')
                    }, {
                        path: 'one',
                        component: () => import('@/views/admin/admSystem/one/index.vue')
                    }
                ]
            },

        ]
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router
